home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol A-4 / (Vol A-4) Vol. A4.iso / Games / selfstorage.swf / scripts / frame_5 / PlaceObject2_188_554 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2008-03-17  |  2KB  |  63 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.int_spiellaeuft == 1)
  3.    {
  4.       schwerpunktx = _root.mc_box0._x;
  5.       maxX = 0;
  6.       minX = 700;
  7.       ar = _root.arr_liegereihenfolge.length;
  8.       while(ar > 1)
  9.       {
  10.          nr = _root.arr_liegereihenfolge[ar - 1];
  11.          nr_darunter = _root.arr_liegereihenfolge[ar - 2];
  12.          maxXtemp = _root["mc_box" + nr]._x + _root["mc_box" + nr]._width / 2;
  13.          if(maxXtemp > maxX)
  14.          {
  15.             maxX = maxXtemp;
  16.          }
  17.          minXtemp = _root["mc_box" + nr]._x - _root["mc_box" + nr]._width / 2;
  18.          if(minXtemp < minX)
  19.          {
  20.             minX = minXtemp;
  21.          }
  22.          this._x = _root["mc_box" + nr]._x + _root["mc_box" + nr]._width / 2;
  23.          schwerpunktx = (maxX - minX) / 2 + minX;
  24.          this._x = schwerpunktx;
  25.          if(!this.hitTest(_root["mc_box" + nr_darunter]))
  26.          {
  27.             xcount = 1;
  28.             if(this._x >= _root["mc_box" + nr]._x)
  29.             {
  30.                trace("Sturz nach rechts");
  31.                ar_sturz = ar;
  32.                while(ar_sturz <= _root.arr_liegereihenfolge.length)
  33.                {
  34.                   nr_sturz = _root.arr_liegereihenfolge[ar_sturz - 1];
  35.                   _root["mc_box" + nr_sturz]._x += xcount * 2;
  36.                   _root["mc_box" + nr_sturz].int_sturzrotation = 1;
  37.                   _root["mc_box" + nr_sturz].int_absturz = 1;
  38.                   _root["mc_box" + nr_sturz]._rotation += xcount * 2;
  39.                   xcount++;
  40.                   ar_sturz++;
  41.                }
  42.             }
  43.             else
  44.             {
  45.                ar_sturz = ar;
  46.                while(ar_sturz <= _root.arr_liegereihenfolge.length)
  47.                {
  48.                   nr_sturz = _root.arr_liegereihenfolge[ar_sturz - 1];
  49.                   _root["mc_box" + nr_sturz]._x -= xcount * 2;
  50.                   _root["mc_box" + nr_sturz].int_sturzrotation = 1;
  51.                   _root["mc_box" + nr_sturz].int_absturz = 1;
  52.                   _root["mc_box" + nr_sturz]._rotation -= xcount * 2;
  53.                   xcount++;
  54.                   ar_sturz++;
  55.                }
  56.             }
  57.             ar = 1;
  58.          }
  59.          ar--;
  60.       }
  61.    }
  62. }
  63.